var trailingZeroes = function(n) {
    var count = 0;
    while (parseInt(n / 5) != 0) {
        count += parseInt(n/5)
        n = parseInt(n/5) ;
    }
    return count;
};

var a = trailingZeroes(8)
console.log(a);
